import { apiAxios, apiDelete } from './index.js'

// 获取化验区域和化验点位
export const getAreaPosition = params => apiAxios.get('wq/area-and-position', params).then(res => res.data)
// 添加化验区域
export const addArea = params => apiAxios.post('wq/areas', params).then(res => res.data)
// 删除化验区域
export const deleteArea = params => apiAxios.delete(`wq/areas/${params}`).then(res => res.data)
export const deleteRangeArea = (that, params) => apiDelete(that, 'wq/areas', params)

// export const deleteRangeArea = params => apiAxios.delete('wq/areas', {
//   params: params,
//   paramsSerializer: params => {return qs.stringify(params, { indices: false })}
// }).then(res => res.data)
// export const deleteRangeArea = params => apiAxios.delete(`wq/areas`,params).then(res => res.data)
// 修改化验区域
export const editArea = params => apiAxios.put('wq/areas', params).then(res => res.data)
// 判断化验区域是否已经存在
export const existAreaName = params => apiAxios.get('wq/areas/exist-name', params).then(res => res.data)
// 添加化验点位
export const addPosition = params => apiAxios.post('wq/area-positions', params).then(res => res.data)
// 删除化验点位
export const deletePosition = params => apiAxios.delete(`wq/area-positions/${params}`).then(res => res.data)
// 修改化验点位
export const editPosition = params => apiAxios.put('wq/area-positions', params).then(res => res.data)
// 判断化验点位是否已经存在
export const existPositionName = params => apiAxios.get('wq/area-positions/exist-name', params).then(res => res.data)
